package DataStructureAndAlgorithm.CSP.Day17;
import java.util.Scanner;
//链接：https://www.acwing.com/problem/content/3280/
public class AcWing_3277 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int sum = 0;
        int index = 0;
        int maxSum = 0;
        for (int k = 1; k <= n; k++){
            int tempSum = 0;
            sum = sum + in.nextInt();
            for (int i = 0; i < m; i++){
                tempSum = tempSum + in.nextInt();
            }
            if (tempSum < maxSum){
                maxSum = tempSum;
                index = k;
            }
            sum += tempSum;
        }
        System.out.println(sum + " " + index + " " + (-maxSum));
    }
}
